<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<!-- 引入样式 -->
	<link rel="stylesheet" href="../css/style.min.css">
</head>
<body>
<header class="mui-bar mui-bar-nav">
	<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	<h1 id="title" class="mui-title">首页</h1>
</header>
<a href="downloader.html">downloader</a>
<div id="app">
	<mt-button @click.native="handleClick">按钮</mt-button>
</div>
</body>
<!-- 先引入 Vue -->
<script src="../js/vue.min.js"></script>
<script src="../js/jquery.min.js"></script>
<!-- 引入组件库 -->
<script src="../js/index.js"></script>
<script>
    var Main = {
        data:function(){
            return {

            }
        },
        filters:{

        },

        mounted:function(){
            this.ready();
        },

        methods:{
            handleClick: function() {
                $.ajax({
                    url:"http://172.19.192.218:8080/api/test_cookie",
                    type:"get",
                    dataType:"JSON",
                    data: {},
                    error:function(XMLHttpRequest,textStatus,errorThrown){
                        vue.$toast('网络异常...');
                    },
                    success:function(XMLHttpRequest,textStatus,errorThrown){
                        alert('ok');
                    }
                })
            },
            ready:function(){
            }
        }
    }
    var Ctor = Vue.extend(Main)
    new Ctor().$mount('#app')
</script>
</html>